<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>scope作用域</title>
  </head>
  <body>
    <div ng-app="myApp" ng-controller="myCtrl">
      <h1>{{lastName}}家庭成员：</h1>
      <ul>
        <li ng-repeat="x in names">{{x}}</li>
      </ul>
    </div>
    <script src="../lib/angular.1.7.8.js"></script>
    <script>
      var app = angular.module('myApp', [])
      app.controller('myCtrl', function($scope, $rootScope) {
        console.log("TCL: $scope", $scope)
        console.log("TCL: $scope", $scope.$broadcast)
        $scope.names = ['lili', 'meme', 'John', 'Tom']
        $rootScope.lastName = 'han'
      })
    </script>
  </body>
</html>
